<template>
  <div class="step-tip-wrapper" v-if="isVisiableShow">
    <div class="shadow-box"></div>
    <div class="step-tip-box">
      <div class="step-tip-content">
        {{ stepContent }}
      </div>
      <div class="step-button">
        <!-- <a-button class="btn" size="small" type="primary" @click="handleNext" style="margin-right: 5px;">跳过当前步骤</a-button> -->
       
        <a-button v-if="store.isExitStatus" class="btn" size="small" type="primary" @click="handleOut">退出教程</a-button>
         <a-button v-else class="btn" size="small" type="primary" @click="handleClose">跳过教程</a-button>
      </div>
    </div>
    <!-- <div class="step-end-all-button">
      <a-button class="btn" @click="handleClose" type="primary"
        >跳过教程</a-button
      >
    </div>
    <div class="step-next-cur-button">
      <a-button class="btn" type="primary" @click="handleNext"
        >跳过当前步骤</a-button
      >
    </div>
    <div class="step-prev-cur-button">
      <a-button class="btn" type="primary" @click="handlePrev"
        >前一步骤</a-button
      >
    </div> -->
  </div>
</template>
<script setup>
import { ref, computed } from "vue";
import { useTipsStore } from "@/store/modules/tips";
const store = useTipsStore();
const props = defineProps({
  showClose: {
    type: Boolean,
    default: true,
  },
});
const isVisiableShow = computed(() => {
  return store.showAutoTip;
});
const stepContent = computed(() => {
  return store.autoTipContent;
});
const handleNext = () => {
  //给3d发送消息，跳过当前步骤
  store.setIsNext(true);
};
const handleOut = () => {
  store.setShowAutoTip(false);
  //给3d发送消息，跳过当前步骤
  store.setIsAutoExit(true);
};
const handleClose = () => {
  store.setShowAutoTip(false);
  store.setIsAutoExit(true);
};
</script>
<style scoped lang="less">
.step-tip-wrapper {
  .shadow-box {
    position: fixed;
    top: 0;
    left: 0;
    height: 50px;
    width: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 1000;
  }
  .step-tip-box {
    position: fixed;
    top: 20%;
    left: 50%;
    transform: translateX(-50%) translateY(-50%);
    background: #fff;
    border-radius: 8px;
    padding: 20px 20px 0;
    max-width: 80%;
    color: #fff;
    overflow: hidden;
    text-align: center;
    z-index: 1000;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    .step-tip-content {
      color: #333;
      font-size: 16px;
      min-width: 200px;
    }
    .step-button {
      border-top: 1px solid #eee;
      padding: 12px 0;
      display: flex;
      margin-top: 12px;
      justify-content: center;
    }
  }
}
.step-end-all-button {
  position: fixed;
  right: 350px;
  top: 10%;
  z-index: 2000;
}
.step-prev-cur-button {
  position: fixed;
  left: 350px;
  bottom: 5%;
  z-index: 2000;
}
.step-next-cur-button {
  position: fixed;
  right: 350px;
  bottom: 5%;
  z-index: 2000;
}
</style>
